package cn.bb.pojo;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.io.Serializable;
@Component("users")
public class User implements Serializable {
    private String name;
    private int age;
    public void printlnijfo(){
        System.out.println("我叫"+name+"今年"+age+"岁");
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
    @PostConstruct
    public void testpost(){
        System.out.println("方法执行前");
    }
    @PreDestroy
    public void afterdes(){
        System.out.println("方法执行后");
    }
}
